import type { RouteRecordRaw } from 'vue-router';

import { createRouter, createWebHistory } from 'vue-router';

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: '/zhu-family/dashboard',
  },
  {
    path: '/zhu-family',
    name: 'ZhuFamily',
    component: () => import('../layouts/BasicLayout.vue'),
    meta: { title: '朱氏皇族' },
    children: [
      {
        path: 'dashboard',
        name: 'Dashboard',
        component: () => import('../views/zhu-family/dashboard/index.vue'),
        meta: { title: '帝国首页', icon: 'CrownOutlined' },
      },
      {
        path: 'genealogy',
        name: 'Genealogy',
        component: () => import('../views/zhu-family/genealogy/index.vue'),
        meta: { title: '皇族世系', icon: 'TeamOutlined' },
      },
      {
        path: 'governance',
        name: 'Governance',
        component: () => import('../views/zhu-family/governance/index.vue'),
        meta: { title: '朝政治理', icon: 'BankOutlined' },
      },
      {
        path: 'kingdom',
        name: 'Kingdom',
        component: () => import('../views/zhu-family/kingdom/index.vue'),
        meta: { title: '藩国管理', icon: 'HomeOutlined' },
      },
      {
        path: 'treasury',
        name: 'Treasury',
        component: () => import('../views/zhu-family/treasury/index.vue'),
        meta: { title: '国库财政', icon: 'MoneyCollectOutlined' },
      },
      {
        path: 'archive',
        name: 'Archive',
        component: () => import('../views/zhu-family/archive/index.vue'),
        meta: { title: '史官档案', icon: 'BookOutlined' },
      },
      {
        path: 'shrine',
        name: 'Shrine',
        component: () =>
          import('../views/zhu-family/shrine/AncestorMemorial.vue'),
        meta: { title: '祖先纪念堂', icon: 'FireOutlined' },
      },
      {
        path: 'timecapsule',
        name: 'TimeCapsule',
        component: () => import('../views/zhu-family/timecapsule/index.vue'),
        meta: { title: '时间胶囊', icon: 'ClockCircleOutlined' },
      },
      {
        path: 'academy/knowledge',
        name: 'AcademyKnowledge',
        component: () =>
          import('../views/zhu-family/academy/KnowledgeBase.vue'),
        meta: { title: '知识库', icon: 'BookOutlined' },
      },
      {
        path: 'academy/courses',
        name: 'AcademyCourses',
        component: () => import('../views/zhu-family/academy/Courses.vue'),
        meta: { title: '课程学习', icon: 'ReadOutlined' },
      },
      {
        path: 'academy/stories',
        name: 'AcademyStories',
        component: () => import('../views/zhu-family/academy/Stories.vue'),
        meta: { title: '家族故事', icon: 'FileTextOutlined' },
      },
      {
        path: 'profile',
        name: 'Profile',
        component: () => import('../views/zhu-family/profile/index.vue'),
        meta: { title: '个人中心', icon: 'UserOutlined' },
      },
      {
        path: 'shrine-3d',
        name: 'Shrine3D',
        component: () => import('../views/zhu-family/shrine-3d/index.vue'),
        meta: { title: '3D虚拟祠堂', icon: 'BuildOutlined' },
      },
      {
        path: 'ai-heir',
        name: 'AIHeir',
        component: () => import('../views/zhu-family/ai-heir/index.vue'),
        meta: { title: 'AI Heir数字孪生', icon: 'RobotOutlined' },
      },
      {
        path: 'wealth',
        name: 'Wealth',
        component: () => import('../views/zhu-family/wealth/index.vue'),
        meta: { title: '财富传承', icon: 'DollarOutlined' },
      },
      {
        path: 'gene-privacy',
        name: 'GenePrivacy',
        component: () => import('../views/zhu-family/gene-privacy/index.vue'),
        meta: { title: '基因隐私', icon: 'ExperimentOutlined' },
      },
      {
        path: 'legal',
        name: 'Legal',
        component: () => import('../views/zhu-family/legal/index.vue'),
        meta: { title: '法律合规', icon: 'SafetyCertificateOutlined' },
      },
      {
        path: 'business',
        name: 'Business',
        component: () => import('../views/zhu-family/business/index.vue'),
        meta: { title: '商业协作', icon: 'ShopOutlined' },
      },
      // 区块链功能路由
      {
        path: 'blockchain/registry',
        name: 'BlockchainRegistry',
        component: () => import('../views/zhu-family/blockchain/FamilyRegistry.vue'),
        meta: { title: '家族注册', icon: 'TeamOutlined' },
      },
      {
        path: 'blockchain/members',
        name: 'BlockchainMembers',
        component: () => import('../views/zhu-family/blockchain/FamilyMembers.vue'),
        meta: { title: '成员管理', icon: 'UserAddOutlined' },
      },
      {
        path: 'blockchain/governance',
        name: 'BlockchainGovernance',
        component: () => import('../views/zhu-family/blockchain/Governance.vue'),
        meta: { title: '链上治理', icon: 'FileTextOutlined' },
      },
      {
        path: 'blockchain/nft',
        name: 'BlockchainNFT',
        component: () => import('../views/zhu-family/blockchain/NFTMint.vue'),
        meta: { title: 'NFT 铸造', icon: 'PictureOutlined' },
      },
      {
        path: 'blockchain/wallet-generator',
        name: 'WalletGenerator',
        component: () => import('../views/zhu-family/blockchain/WalletGenerator.vue'),
        meta: { title: '钱包生成器', icon: 'WalletOutlined' },
      },
    ],
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;
